package cn.mebius.lbslangchain4j.controller;

import cn.mebius.lbslangchain4j.service.ConsultantServicet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

@RestController
public class ChatController {

    private final ConsultantServicet consultantServicet;

    @Autowired
    ChatController(ConsultantServicet consultantServicet) {
        this.consultantServicet = consultantServicet;
    }


    @PostMapping("/chat")
    public Flux<String> chat(String prompt) {
        return consultantServicet.chat(prompt);
    }
}
